﻿@using System.ComponentModel
@model Coevery.Perspectives.ViewModels.NavigationViewModel
@{
    var iconClass = string.IsNullOrWhiteSpace(Model.IconClass) ? null : Model.IconClass;
}
<header id="page-title">
    <h1 class="pull-left">@T("Navigation Item Detail") <span>show navigation item detail information</span></h1>
</header>

<section id="main-content" style="margin-top: 47px">
    <div id="page-actions" class="clearfix">
        <btn-actions>
            <button type="button" class="btn btn-small" data-ng-click="exit()">Back</button>
            <button type="button" class="btn btn-small btn-primary" data-indi-click="saveAndView()">Save</button>
            <button class="btn btn-small btn-primary" data-indi-click="saveAndBack()">Save & Back</button>
        </btn-actions>
    </div>

    <div class="row-fluid">
        <div class="span12">
            <div class="form-horizontal no-border">
                @using (Html.BeginFormAntiForgeryPost(Url.Action("CreateNavigationItem", new { perspectiveId = Model.PrespectiveId, navigationId = Model.NavigationId, ReturnUrl = Request.QueryString["ReturnUrl"] }),
                                                  FormMethod.Post,
                                                  new { @class = "form-horizontal edit-mode", @name = "myForm", @ng_submit = "save()" }))
                {
                    <fieldset>
                        <legend>General Information</legend>
                        <section class="data-row control-group">
                            <label class="control-label">Title</label>
                            <div class="controls">
                                @Html.TextBoxFor(m => m.Title, new { @readonly = "readonly", @class = "span12" })
                            </div>
                        </section>
                        <section class="data-row control-group">
                            <label class="control-label required">Entity</label>
                            <div class="controls errortips">
                                @Html.DropDownList("EntityName", Model.Entities, new { id = "EntityName" ,required=""})
                            </div>
                        </section>
                        <section class="data-row control-group">
                            <label class="control-label">Color</label>
                            <div class="controls">
                                <input id="color" type="text" class="minicolors">
                            </div>
                        </section>
                        <section class="data-row control-group">
                            <label class="control-label required">Icon</label>
                            <div class="controls errortips">
                                @*<input type="file" id="input04" data-provide="fileinput">*@
                                <i id="showIconClass" class="@iconClass"></i>                                
                                <button type="button" class="btn btn-small" ng-click="openDialog()">Select</button>
                                @Html.HiddenFor(m => m.IconClass, new { id = "hfIconClass" ,required = "" })
                            </div>
                        </section>
                    </fieldset>
                }
            </div>
        </div>
    </div>
</section>
<div modal="dialogSelectIcons" close="closeDialog()" options="opts" class="ng-cloak">
    @Html.Partial("SelectIconClass")
</div>
